home *** CD-ROM | disk | FTP | other *** search
- head 0.13;
- access;
- symbols;
- locks
- dennisg:0.13; strict;
- comment @ * @;
-
-
- 0.13
- date 92.04.13.11.40.53; author dennisg; state Exp;
- branches;
- next 0.12;
-
- 0.12
- date 92.01.03.02.57.08; author dennisg; state Exp;
- branches;
- next 0.11;
-
- 0.11
- date 91.12.10.12.03.22; author dennisg; state Exp;
- branches;
- next 0.10;
-
- 0.10
- date 91.12.07.00.57.20; author dennisg; state Exp;
- branches;
- next 0.9;
-
- 0.9
- date 91.12.06.00.36.24; author dennisg; state Exp;
- branches;
- next 0.8;
-
- 0.8
- date 91.12.01.01.29.29; author dennisg; state Exp;
- branches;
- next 0.7;
-
- 0.7
- date 91.11.29.22.00.10; author dennisg; state Exp;
- branches;
- next 0.6;
-
- 0.6
- date 91.11.29.20.02.01; author dennisg; state Exp;
- branches;
- next 0.5;
-
- 0.5
- date 91.11.29.13.32.16; author dennisg; state Exp;
- branches;
- next 0.4;
-
- 0.4
- date 91.11.29.00.24.14; author dennisg; state Exp;
- branches;
- next 0.3;
-
- 0.3
- date 91.11.16.16.26.02; author dennisg; state Exp;
- branches;
- next 0.2;
-
- 0.2
- date 91.11.07.22.31.42; author dennisg; state Exp;
- branches;
- next 0.1;
-
- 0.1
- date 91.10.24.00.19.24; author dennisg; state Exp;
- branches;
- next ;
-
-
- desc
- @This file contains function prototypes of the Objective-C
- run-time system available to users.
- @
-
-
- 0.13
- log
- @Check in after array version of run-time works.
- Expect more changes as hash version and other changes are made.
- @
- text
- @/* -*-c-*-
- * This file contains prototype declarations of functions
- * provided by the run-time system.
- *
- * Copyright (C) 1991 Threaded Technologies Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 1, or any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should receive a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- $Header: /usr/user/dennis_glatting/ObjC/c-runtime/include/RCS/ObjC-proto.h,v 0.12 1992/01/03 02:57:08 dennisg Exp dennisg $
- $Author: dennisg $
- $Date: 1992/01/03 02:57:08 $
- $Log: ObjC-proto.h,v $
- * Revision 0.12 1992/01/03 02:57:08 dennisg
- * modified to handle new initialization scheme.
- * fixed code structure.
- *
- * Revision 0.11 1991/12/10 12:03:22 dennisg
- * Cleaned up file format for a distribution.
- * Added a prototype for archiving. Now all I have to do is write it.
- *
- * Revision 0.10 1991/12/07 00:57:20 dennisg
- * added objc_classSize() prototype.
- *
- * Revision 0.9 1991/12/06 00:36:24 dennisg
- * added type decls for objc_msgSend*().
- *
- * Revision 0.8 1991/12/01 01:29:29 dennisg
- * modified to remove changes previously made to
- * implement posing. posing just got easy.
- *
- * Revision 0.7 1991/11/29 22:00:10 dennisg
- * modified to implement set functions.
- *
- * Revision 0.6 1991/11/29 20:02:01 dennisg
- * fixed several const decls. bozo.
- *
- * Revision 0.5 1991/11/29 13:32:16 dennisg
- * committed some functions to inline and changes prototypes
- * to match.
- * also added some documentation.
- *
- * Revision 0.4 1991/11/29 00:24:14 dennisg
- * many changes including posing, things to make the compiler
- * happier, structure changes, and things to make it play better.
- *
- * Revision 0.3 1991/11/16 16:26:02 dennisg
- * changed some prototypes to make
- * the compiler happier.
- *
- * Revision 0.2 1991/11/07 22:31:42 dennisg
- * added copyleft.
- *
- * Revision 0.1 1991/10/24 00:19:24 dennisg
- * Initial check in. Preliminary development stage.
- *
- */
-
-
- #ifndef _objc_proto_INCLUDE_GNU
- #define _objc_proto_INCLUDE_GNU
-
- #include <objc.h>
- #include <objc-protoP.h>
-
- #include <stdlib.h>
-
-
- /*
- * Compiler defined prototypes.
- * These prototypes can't be defined if we're
- * compiling Objective-C code.
- */
- #ifndef __OBJC__
- /*
- * objc_getClass() returns the id of the class
- * object for the aClassName class. The class
- * object holds information used by instances of
- * the class.
- *
- * Print a message to the standard error stream if
- * aClassName isn't part of the executable image.
- */
- Class_t
- objc_getClass (const char*);
-
- /*
- * objc_getMetaClass() returns the id of the
- * meta class object for the aClassName class.
- * The meta class object holds information used
- * by the class object, just as the class
- * object holds information used by instances
- * of the class.
- *
- * Print a message to the standard error stream
- * if aClassName isn't part of the executable image.
- */
- MetaClass_t
- objc_getMetaClass (const char*);
-
- /*
- * The compiler converts every message expression into a
- * call on one of these two functions. Messages to
- * super are converted to calls on objc_msgSendSuper();
- * all others are converted to calls on objc_msgSend().
- *
- * These functions return the address of the method
- * implementation. The compiler then generates calls
- * to those methods passing the full argument array.
- *
- * Calls to objc_msgSend() and objc_msgSendSuper()
- * should be generated only by the compiler. You shouldn't
- * call them directly in the Objective-C code you write.
- */
- IMP
- objc_msgSend (id, SEL);
-
- IMP
- objc_msgSendSuper (Super_t, SEL);
- #endif
-
- /*
- * Given the name of a variable within a class's
- * definition, return a pointer to a structure that
- * describes it.
- */
- Ivar_t
- object_getIvarAddress (id aObject, const char* variableName);
-
- /*
- * Given a class and a selector, return a pointer to the method's method
- * structure. Return NULL if not found.
- *
- * This is a method internal to the run-time.
- */
- Method_t
- searchForMethodInHierarchy (Class_t, SEL);
-
-
- /*
- * class_getInstanceMethod() returns a pointer
- * to the data structure that describes the method.
- *
- * The selector must identify an
- * instance method.
- *
- * Return a NULL pointer if aSelector doesn't
- * identify a method defined in or inherited
- * by aClass.
- */
- static inline Method_t
- class_getInstanceMethod (Class_t aClass, SEL aSel) {
-
- return searchForMethodInHierarchy (aClass, aSel);
- }
-
- /*
- * class_getClassMethod() returns a pointer to
- * the data structure that describes the method.
- *
- * The selector must identify a class (factory) method.
- *
- * Return a NULL pointer if aSelector doesn't
- * identify a method defined in or inherited by aClass.
- */
- static inline Method_t
- class_getClassMethod (MetaClass_t aClass, SEL aSel) {
-
- return searchForMethodInHierarchy ((Class_t)aClass, aSel);
- }
-
- /*
- * This function returns the name of aObject's
- * class. anObject should be an instance
- * object, not a class object.
- */
- static inline const char*
- object_getClassName (id aObject) {
-
- return aObject->isa->name;
- }
-
- /*
- * This function returns the name of the
- * class.
- */
- static inline const char*
- class_getClassName (Class_t aClassObject) {
-
- return aClassObject->name;
- }
-
- /*
- * The first function, sel_getUid(), returns a selector that's
- * used at run time to identify the aName method. Whenever
- * possible, you should use the @@selector() directive to
- * ask the compiler, rather than the run-time system,
- * to provide the selector for a method. This function
- * should be used only if the name isn't known at compile
- * time.
- *
- * The second function, sel_getName(), is the inverse
- * of the first. It returns the name that was mapped to
- * aSelector.
- */
- SEL
- sel_getUid (const STR);
-
- const STR
- sel_getName (SEL);
-
- /*
- * class_addInstanceMethods() adds methods that can be
- * used by instances of the class and class_addClassMethods()
- * adds methods used by the class object. Before adding a
- * method, both functions check for duplicates. A warning
- * is sent to the standard error stream if any ambiguities exist.
- *
- * The passed structure and its contents must exist for the the
- * duration of the program. These functions don't support
- * linked structures.
- */
- static inline void
- class_addInstanceMethods (Class_t aClass, MethodList_t aMethodList) {
-
- addMethodsToClass (aClass, aMethodList);
- }
-
- static inline void
- class_addClassMethods (Class_t aClass, MethodList_t aMethodList) {
-
- addMethodsToClass ((Class_t)aClass->isa, aMethodList);
- }
-
- /*
- * This function returns the number of bytes that all of aMethod's
- * arguments, taken together, would occupy on the stack.
- */
- static inline u_int
- method_getSizeOfArguments (Method_t aMethod) {
-
- return atoi (&aMethod->method_types[1]);
- }
-
- /*
- * This function returns the size in bytes of a
- * instance of aObject.
- */
- static inline long
- objc_classSize (id aObject) {
-
- return aObject->isa->instance_size;
- }
-
- /*
- * This function returns the number of arguments that aMethod
- * the takes. This will be at least two, since it
- * includes the “hidden” arguments, self and _cmd,
- * which are the first two arguments passed to every
- * method implementation.
- */
- u_int
- method_getNumberOfArguments (Method_t aMethod);
-
- /* This functiontakes an index into aMethod's argument
- * list and returns, by reference, the type of the argument
- * and the offset to the location of that argument in the
- * list. Indices begin with 0. The “hidden” arguments
- * self and _cmd are indexed at 0 and 1; method-specific
- * arguments begin at index 2. The offset is measured in
- * bytes and depends on the size of arguments preceding the
- * indexed argument in the argument list. The type is
- * encoded according to the conventions of the @@encode()
- * compiler directive.
- */
- u_int
- method_getArgumentInfo (Method_t aMethod,
- int indx, const char **type, int *offset);
-
- /*
- * This function is used to support archiving when a unknown class is to read
- * from a archive. This function returns a instantiated object. To further
- * dearchive the object it should be sent: -readFrom:.
- *
- * This function positions the file pointer just past class Object's class
- * data.
- */
- id
- objc_objectFromFile (int aFd);
-
- #endif
-
- @
-
-
- 0.12
- log
- @modified to handle new initialization scheme.
- fixed code structure.
- @
- text
- @d20 1
- a20 1
- $Header: /usr/user/dennis_glatting/ObjC/c-runtime/include/RCS/ObjC-proto.h,v 0.11 1991/12/10 12:03:22 dennisg Exp dennisg $
- d22 1
- a22 1
- $Date: 1991/12/10 12:03:22 $
- d24 4
- d73 2
- a74 2
- #include <ObjC.h>
- #include <ObjC-proto-private.h>
- d94 2
- a95 1
- Class_t objc_getClass( const char* );
- d108 2
- a109 1
- MetaClass_t objc_getMetaClass( const char* );
- d125 5
- a129 2
- IMP objc_msgSend (id theReceiver, SEL aSel);
- IMP objc_msgSendSuper (Super_t superContext, SEL aSel);
- d137 2
- a138 1
- Ivar_t object_getIvarAddress( id aObject, const char* variableName );
- d141 10
- d162 1
- a162 1
- class_getInstanceMethod (Class_t aClass, SEL aSel) {
- d177 1
- a177 1
- class_getClassMethod (MetaClass_t aClass, SEL aSel) {
- d188 1
- a188 1
- object_getClassName (id aObject) {
- d198 1
- a198 1
- class_getClassName (Class_t aClassObject) {
- d216 2
- a217 2
- static inline SEL
- sel_getUid (const STR aName) {
- d219 2
- a220 2
- return (SEL)aName ;
- }
- a221 6
- static inline const STR
- sel_getName (SEL aSelector) {
-
- return (const STR)aSelector ;
- }
-
- d234 1
- a234 1
- class_addInstanceMethods (Class_t aClass, MethodList_t aMethodList) {
- d240 1
- a240 1
- class_addClassMethods (Class_t aClass, MethodList_t aMethodList) {
- d250 1
- a250 1
- method_getSizeOfArguments (Method_t aMethod) {
- d260 1
- a260 1
- objc_classSize (id aObject) {
- d272 2
- a273 1
- u_int method_getNumberOfArguments (Method_t aMethod);
- d286 2
- a287 1
- u_int method_getArgumentInfo (Method_t aMethod,
- d298 2
- a299 1
- id objc_objectFromFile (int aFd);
- @
-
-
- 0.11
- log
- @Cleaned up file format for a distribution.
- Added a prototype for archiving. Now all I have to do is write it.
- @
- text
- @d20 1
- a20 1
- $Header: /usr/user/dennis_glatting/ObjC/c-runtime/include/RCS/ObjC-proto.h,v 0.10 1991/12/07 00:57:20 dennisg Exp dennisg $
- d22 1
- a22 1
- $Date: 1991/12/07 00:57:20 $
- d24 4
- d276 2
- a277 2
- * from a archive. This function returns a instantiated object. To further
- * dearchive the object it should be sent: -readFrom:.
- d280 1
- a280 1
- * data.
- d282 1
- a282 1
- id objc_objectFromFile (int aFd);
- @
-
-
- 0.10
- log
- @added objc_classSize() prototype.
- @
- text
- @d20 1
- a20 1
- $Header: /usr/user/dennis_glatting/ObjC/c-runtime/include/RCS/ObjC-proto.h,v 0.9 1991/12/06 00:36:24 dennisg Exp dennisg $
- d22 1
- a22 1
- $Date: 1991/12/06 00:36:24 $
- d24 3
- d66 1
- a66 1
- #include <ObjC-proto-private.h>
- d68 1
- a68 1
- #include <stdlib.h>
- d73 2
- a74 2
- * These prototypes can't be defined if we're
- * compiling Objective-C code.
- d86 1
- a86 1
- Class_t objc_getClass( const char* );
- d99 1
- a99 1
- MetaClass_t objc_getMetaClass( const char* );
- d103 3
- a105 3
- * call on one of these two functions. Messages to
- * super are converted to calls on objc_msgSendSuper();
- * all others are converted to calls on objc_msgSend().
- d108 2
- a109 2
- * implementation. The compiler then generates calls
- * to those methods passing the full argument array.
- d112 2
- a113 2
- * should be generated only by the compiler. You shouldn't
- * call them directly in the Objective-C code you write.
- d124 1
- a124 1
- Ivar_t object_getIvarAddress( id aObject, const char* variableName );
- d138 1
- a138 1
- class_getInstanceMethod (Class_t aClass, SEL aSel) {
- d153 1
- a153 1
- class_getClassMethod (MetaClass_t aClass, SEL aSel) {
- d164 1
- a164 1
- object_getClassName (id aObject) {
- d174 1
- a174 1
- class_getClassName (Class_t aClassObject) {
- d181 6
- a186 6
- * used at run time to identify the aName method. Whenever
- * possible, you should use the @@selector() directive to
- * ask the compiler, rather than the run-time system,
- * to provide the selector for a method. This function
- * should be used only if the name isn't known at compile
- * time.
- d189 2
- a190 2
- * of the first. It returns the name that was mapped to
- * aSelector.
- d193 1
- a193 1
- sel_getUid (const STR aName) {
- d195 1
- a195 1
- return (SEL)aName ;
- d199 1
- a199 1
- sel_getName (SEL aSelector) {
- d201 1
- a201 1
- return (const STR)aSelector ;
- d206 4
- a209 4
- * used by instances of the class and class_addClassMethods()
- * adds methods used by the class object. Before adding a
- * method, both functions check for duplicates. A warning
- * is sent to the standard error stream if any ambiguities exist.
- d212 2
- a213 2
- * duration of the program. These functions don't support
- * linked structures.
- d216 1
- a216 1
- class_addInstanceMethods (Class_t aClass, MethodList_t aMethodList) {
- d222 1
- a222 1
- class_addClassMethods (Class_t aClass, MethodList_t aMethodList) {
- d229 1
- a229 1
- * arguments, taken together, would occupy on the stack.
- d232 1
- a232 1
- method_getSizeOfArguments (Method_t aMethod) {
- d234 1
- a234 1
- return atoi (&aMethod->method_types[1]);
- d239 1
- a239 1
- * instance of aObject.
- d242 3
- a244 3
- objc_classSize (id aObject) {
-
- return aObject->isa->instance_size;
- d249 4
- a252 4
- * the takes. This will be at least two, since it
- * includes the “hidden” arguments, self and _cmd,
- * which are the first two arguments passed to every
- * method implementation.
- d257 9
- a265 9
- * list and returns, by reference, the type of the argument
- * and the offset to the location of that argument in the
- * list. Indices begin with 0. The “hidden” arguments
- * self and _cmd are indexed at 0 and 1; method-specific
- * arguments begin at index 2. The offset is measured in
- * bytes and depends on the size of arguments preceding the
- * indexed argument in the argument list. The type is
- * encoded according to the conventions of the @@encode()
- * compiler directive.
- d268 1
- a268 1
- int indx, const char **type, int *offset);
- d270 9
- @
-
-
- 0.9
- log
- @added type decls for objc_msgSend*().
- @
- text
- @d20 1
- a20 1
- $Header: /usr/user/dennis_glatting/ObjC/c-runtime/include/RCS/ObjC-proto.h,v 0.8 1991/12/01 01:29:29 dennisg Exp dennisg $
- d22 1
- a22 1
- $Date: 1991/12/01 01:29:29 $
- d24 3
- d232 10
- @
-
-
- 0.8
- log
- @modified to remove changes previously made to
- implement posing. posing just got easy.
- @
- text
- @d20 1
- a20 1
- $Header: /usr/user/dennis_glatting/ObjC/c-runtime/include/RCS/ObjC-proto.h,v 0.7 1991/11/29 22:00:10 dennisg Exp dennisg $
- d22 1
- a22 1
- $Date: 1991/11/29 22:00:10 $
- d24 4
- d94 17
- @
-
-
- 0.7
- log
- @modified to implement set functions.
- @
- text
- @d20 1
- a20 1
- $Header: /usr/user/dennis_glatting/ObjC/c-runtime/include/RCS/ObjC-proto.h,v 0.6 1991/11/29 20:02:01 dennisg Exp dennisg $
- d22 1
- a22 1
- $Date: 1991/11/29 20:02:01 $
- d24 3
- d113 1
- a113 1
- return searchForMethodInHierarchy (aClass, aSel, NO);
- d128 1
- a128 1
- return searchForMethodInHierarchy ((Class_t)aClass, aSel, NO);
- @
-
-
- 0.6
- log
- @fixed several const decls. bozo.
- @
- text
- @d20 1
- a20 1
- $Header: /usr/user/dennis_glatting/ObjC/c-runtime/include/RCS/ObjC-proto.h,v 0.5 1991/11/29 13:32:16 dennisg Exp dennisg $
- d22 1
- a22 1
- $Date: 1991/11/29 13:32:16 $
- d24 3
- d94 1
- a94 1
- Ivar_t object_getIvarAddress( id, const STR );
- d129 1
- a129 1
- * This function returns the name of anObject's
- d134 1
- a134 1
- object_getClassName (id anObject) {
- d136 1
- a136 1
- return anObject->isa->name;
- a149 45
- * This function creates a new instance of aClass,
- * initializes its isa instance variable to point
- * to the class, and return the new instance.
- *
- * All other instance variables are initialized to 0.
- */
- id class_createInstance( Class_t, u_int );
-
- /*
- * This function destroys a instance of a
- * class.
- *
- * This function always returns nil.
- */
- id class_destroyInstance( id );
-
- /*
- * This function causes one class to pose as its
- * super class. Messages sent to the super class will
- * actually be sent to the posing class.
- *
- * Instance variables should not be declared in the
- * posing class. The posing class can add new methods to
- * the class or override existing methods in the super class.
- */
- Class_t class_poseAs(Class_t, Class_t);
-
- /*
- * These functions set and return the
- * class version number.
- */
- static inline void
- class_setVersion(Class_t aClass, long theVersion) {
-
- aClass->version = theVersion ;
- aClass->isa->version = theVersion ;
- }
-
- static inline long
- class_getVersion(Class_t aClass) {
-
- return aClass->version ;
- }
-
- /*
- d197 4
- a200 1
-
- d206 24
- @
-
-
- 0.5
- log
- @committed some functions to inline and changes prototypes
- to match.
- also added some documentation.
- @
- text
- @d20 1
- a20 1
- $Header: /usr/user/dennis_glatting/ObjC/c-runtime/include/RCS/ObjC-proto.h,v 0.4 1991/11/29 00:24:14 dennisg Exp dennisg $
- d22 1
- a22 1
- $Date: 1991/11/29 00:24:14 $
- d24 5
- d52 1
- d54 1
- d70 1
- a70 1
- Class_t objc_getClass( char* const );
- d83 1
- a83 1
- MetaClass_t objc_getMetaClass( char* const );
- d91 1
- a91 1
- Ivar_t object_getIvarAddress( id, STR const );
- d130 1
- a130 1
- static inline STR const
- d140 1
- a140 1
- static inline STR const
- d153 1
- a153 1
- id class_createInstance( Class_t, u_int );
- d161 1
- a161 1
- id class_destroyInstance( id );
- d172 1
- a172 1
- Class_t class_poseAs(Class_t, Class_t);
- d205 1
- a205 1
- sel_getUid (STR aName) {
- d210 1
- a210 1
- static inline STR
- d213 1
- a213 1
- return (STR)aSelector ;
- d240 5
- @
-
-
- 0.4
- log
- @many changes including posing, things to make the compiler
- happier, structure changes, and things to make it play better.
- @
- text
- @d20 1
- a20 1
- $Header: /usr/user/dennis_glatting/ObjC/c-runtime/include/RCS/ObjC-proto.h,v 0.3 1991/11/16 16:26:02 dennisg Exp dennisg $
- d22 1
- a22 1
- $Date: 1991/11/16 16:26:02 $
- d24 4
- d38 1
- a38 1
- */
- d45 1
- a47 1
-
- d97 2
- a98 1
- Method_t class_getInstanceMethod( Class_t, SEL );
- d100 3
- d112 2
- a113 1
- Method_t class_getClassMethod( MetaClass_t, SEL );
- d115 3
- d123 2
- a124 1
- STR const object_getClassName( id );
- d126 3
- d133 2
- a134 1
- STR const class_getClassName( Class_t );
- d136 3
- d168 2
- a169 2
- * This function (or macro in this case) convers a integer of char*
- * to a selector. You should always use this function at run-time.
- d171 61
- a231 1
- #define cvtToSel(aSel) ((SEL)(aSel))
- @
-
-
- 0.3
- log
- @changed some prototypes to make
- the compiler happier.
- @
- text
- @d20 1
- a20 1
- $Header: /usr/user/dennis_glatting/ObjC/c-runtime/include/RCS/ObjC-proto.h,v 0.2 1991/11/07 22:31:42 dennisg Exp dennisg $
- d22 1
- a22 1
- $Date: 1991/11/07 22:31:42 $
- d24 4
- d135 17
- @
-
-
- 0.2
- log
- @added copyleft.
- @
- text
- @d20 1
- a20 1
- $Header: /usr/user/dennis_glatting/ObjC/c-runtime/include/RCS/ObjC-proto.h,v 0.1 1991/10/24 00:19:24 dennisg Exp dennisg $
- d22 1
- a22 1
- $Date: 1991/10/24 00:19:24 $
- d24 3
- a39 3
- id objc_msgSend( id, SEL, ...);
- id objc_msgSendSuper( Super_t, SEL, ...);
-
- d41 3
- a43 3
- * Given the name of a variable within a class's
- * definition, return a pointer to a structure that
- * describes it.
- d45 1
- a45 2
- Ivar_t object_getIvarAddress( id, STR );
-
- d55 1
- a55 1
- Class_t objc_getClass( const char* );
- d68 2
- a69 1
- MetaClass_t objc_getMetaClass( const char* );
- d72 7
- d107 1
- a107 1
- STR object_getClassName( id );
- d113 1
- a113 1
- STR class_getClassName( Class_t );
- @
-
-
- 0.1
- log
- @Initial check in. Preliminary development stage.
- @
- text
- @d5 22
- a26 4
- $Header$
- $Author$
- $Date$
- $Log$
- @
-